#!/usr/bin/lua

local juci = require("juci.core"); 
local json = require("juci.json"); 
require("ubus"); 

local conn = ubus.connect(); 
local acl = conn:call("session", "access", { ubus_rpc_session = juci.query("sid") }); 

print("Content-Type: text/plain\n"); 

if(not juci.session.access(juci.query("sid"), "juci-io", "backup", { "read" })) then 
	print("Access Denied!"); 
	os.exit(1); 
end 

local log = juci.shell("logread"); 
print(log); 
